ParcelLabel API
Download Label(s)
Resource URL
UAT:
Download all labels generated within a consignment:
https://api.uat.nzpost.co.nz/ParcelLabel/v3/labels/{consignment_id}?format=PDF
Download a label generated within a consignment:
https://api.uat.nzpost.co.nz/ParcelLabel/v3/labels/{consignment_id}?format=PNG&page={page_number}
Production:
Download all labels generated within a consignment:
https://api.nzpost.co.nz/ParcelLabel/v3/labels/{consignment_id}?format=PDF
Download a label generated within a consignment:
https://api.nzpost.co.nz/ParcelLabel/v3/labels/{consignment_id}?format=PNG&page={page_number}
Resource Description
Returns all label images or a specific page image within a consignment. To download all label images within a consignment, set format parameter to "PDF" To download a specific label image within a consignment, set format parameter to "PNG" and set page parameter to the page number of the label. Labels are only available for download of a consignment with status "Complete". Use Get Status of Labels resource to check the status of the consignment prior to download.
Resource Information
Attribute | Detail |
---|---|
Response Format | JSON |
Requires Authentication | Yes |
Rate Limited | 15 calls per second. If rate limit is exceeded, calls will be queued. Calls unprocessed for over 60 seconds will time out. |
Request Parameters
Field Name | Description | Mand | Example |
---|---|---|---|
consignment_id | The unique id of a consignment | Yes | 7EDZHE |
format | The format of the labels to be downloaded. PDF if download all labels within a consignment. PNG if download a page image within a consignment | Yes | |
page | The page number if download a label | No | 1 |
Sample Requests
Download all labels generated within a consignment:
https://api.uat.nzpost.co.nz/ParcelLabel/v3/labels/LLT2BL?format=PDF
Download a label generated within a consignment:
https://api.uat.nzpost.co.nz/ParcelLabel/v3/labels/LLT2BL?format=PNG&page=1
Response
The label image is returned.
Field Name | Description | Mand | Example |
---|---|---|---|
label | pdf or png of label of the requested consignment | Yes | response.pdf |
Sample Response
Sample: Failure
{
"errors": [ {
"code": "400002",
"details": "When downloading a label in PNG format, the page requested must be greater than 0.",
"message": "Invalid parameter(s)"
}],
"message_id": "9903db80-381e-11e6-ade7-027b5f7c4691",
"success": false
}